<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
<link href="lib/Hui-iconfont/1.0.6/iconfont.css" rel="stylesheet" type="text/css" />
<link href="lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<style>
.rule-con{margin:10px 0px 30px 20px;}
.mleft{margin-left:-150px;}
.wimg{margin-left:20px;margin-top:-55px;height:90px;border:0px solid white;}
.bor{width:820px;height:20px;border-bottom:1px solid #ddd;}
.gname{width:200px;display:inline-block;margin-left:30px;}
a:hover{text-decoration:none;color:black;}
</style>
<title>新增推广人员</title>
</head>
<body>
<div class="pd-20">
	<form action="<%=path%>/backstage/t_promote_addOrUpdate" method="post"  class="form form-horizontal" id="form-t_promote_addOrUpdate">
		<input type="hidden" id="id" name="id" value='${t_promote.id}' />

        <div class="row cl">
			<label class="form-label col-2">所属县市：</label>
			<div class="formControls col-3">
				<span class="select-box">
					<select id="cityid" name="city_id" class="select" datatype="n" nullmsg="请选择县市">
						<c:forEach items="${citys}" var="city">
						<option value="${city.id}" <c:if test="${city.id==t_promote.city_id}">selected</c:if> >${city.name}</option>
						</c:forEach>
					</select>
				</span>
			</div>
			<label class="form-label col-2">推广人姓名：</label>
			<div class="formControls col-3">
				<input type="text" class="input-text" style=" width:280px;"  name="name"  value="${t_promote.name }">
			</div>
		</div>

		<div class="row cl">
			<label class="form-label col-2">邀请码</label>
			<div class="formControls col-3">
				<input type="text" name="invite_code" id="invite_code" value="${t_promote.invite_code }" class="input-text" style=" width:180px;">
			</div>
		</div>
		<div class="row cl">
			<div class="col-10 col-offset-2">
				<button onClick="t_promote_submit();" class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存并提交</button>
				<button onClick="layer_close();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
			</div>
		</div>
		<br>
		</form>
</div>	
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="lib/layer/2.1/layer.js"></script> 
<script type="text/javascript" src="lib/My97DatePicker/WdatePicker.js"></script> 
<script type="text/javascript" src="lib/icheck/jquery.icheck.min.js"></script> 
<script type="text/javascript" src="lib/Validform/5.3.2/Validform.min.js"></script> 
<script type="text/javascript" src="lib/webuploader/0.1.5/webuploader.min.js"></script> 
<script type="text/javascript" src="lib/ueditor/1.4.3/ueditor.config.js"></script>
<script type="text/javascript" src="lib/ueditor/1.4.3/ueditor.all.min.js"> </script>
<script type="text/javascript" src="lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" src="js/H-ui.js"></script> 
<script type="text/javascript" src="js/H-ui.admin.js"></script> 
<script type="text/javascript" src="js/jquery.form.js"></script> 
<script type="text/javascript">

$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
});

function t_promote_submit(){
	$("#form-t_promote_addOrUpdate").Validform({
		tiptype:2,
		ajaxPost:true,
		datatype:"json",
		callback:function(data){
			var code = data.error;
			if(code=="0000"){
				var index = parent.layer.getFrameIndex(window.name);
				if (index){//关闭弹出层
					parent.$('.btn-refresh').click(); 
					parent.layer.close(index);
				}else{//单独的页面
					location.href = "<%=path%>/backstage/t_promote_list"; 
				}
			}else{
				//Validform_info
				
				layer.msg(data.information, {icon:5,time:1000});
			}
		} 
	});
	
}

</script>
</body>
</html>

